import 'package:flutter/material.dart';

class ListViewseparated extends StatelessWidget {
  const ListViewseparated({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ListView.separated(
      itemBuilder: (BuildContext context, int index) {
        return Container(
          alignment: Alignment.center,
          margin: const EdgeInsets.all(10),
          decoration: const BoxDecoration(
            color: Colors.blue,
            borderRadius: BorderRadius.all(Radius.circular(10)),
          ),
          width: double.infinity,
          height: 100,
          child: Text("第${index + 1}个"),
        );
      },
      itemCount: 10,
      separatorBuilder: (context, index) {
        return Container(
          margin:
              const EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
          height: 10,
          color: Colors.red,
        );
      },
    );
  }
}
